package practice;

public class practice007 {
	// 输入一个数输出他的位置
	// 1
	// 2 3
	// 4 5 6
	// 7 8 9 10
	// .....
	public static void main(String[] args) {
		int x = 1, y = 1, t, m = 1, n = 1;
		t = 7;

		if (t <= 0) {
			System.out.println("input error");
			return;
		}

		for (; m != 0;) {
			m = t - n;
			if (m != 0) {
				n++;
				y++;
			}
			if (x < y) {
				x++;
				y = 1;
			}
		}
		System.out.println(String.format("x=%d,y=%d", x, y));

	}

}
